Index: EXAMPLES/1bdd.seq
===================================================================
--- EXAMPLES/1bdd.seq	(revision 9f146faf232f2214724e0a5079115955f765219f)
+++ EXAMPLES/1bdd.seq	(revision 3fbbfbbb0ad62653963eff7d22c1c42d1f789438)
@@ -5,2 +5,3 @@
   SER GLN SER ALA ASN LEU LEU ALA GLU ALA 
   LYS LYS LEU ASN ASP ALA
+
Index: INCL.H
===================================================================
--- INCL.H	(revision 9f146faf232f2214724e0a5079115955f765219f)
+++ INCL.H	(revision 3fbbfbbb0ad62653963eff7d22c1c42d1f789438)
@@ -8,5 +8,5 @@
       integer mxhbac, mxtybl, mxtyba, mxtyto, mxrt, mxvrrt, mxrtsu
       integer nrsty
-!      integer MAXLOGLEVEL, LOGFILEUNIT
+      integer MAXLOGLEVEL, LOGFILEUNIT
       double precision pi, pi2, pi4, crd, cdr, zero, one
       integer izero, ione
@@ -52,4 +52,5 @@
       integer enysolct
       double precision boxsize
+      common /log/MAXLOGLEVEL,LOGFILEUNIT
       common /counter/enysolct
       common /commonrandom/ seed
Index: algorithms.py
===================================================================
--- algorithms.py	(revision 9f146faf232f2214724e0a5079115955f765219f)
+++ algorithms.py	(revision 3fbbfbbb0ad62653963eff7d22c1c42d1f789438)
@@ -11,5 +11,5 @@
 from protein import *
 
-class CanonicalMonteCarlo:
+class CanonicalMonteCarlo(object):
     """An implementation of a canonical Monte Carlo run using Metropolis weights.
     After a Monte-Carlo sweep over all internal variables, this implementation 
Index: enyshe.f
===================================================================
--- enyshe.f	(revision 9f146faf232f2214724e0a5079115955f765219f)
+++ enyshe.f	(revision 3fbbfbbb0ad62653963eff7d22c1c42d1f789438)
@@ -10,18 +10,16 @@
 ! **************************************************************
 
+!> PURPOSE: Calculate internal energy of molecule 'nml' with ECEPP parameters
+!!
+!! CALLS: none
+!!
+!! The function loops over all moving sets within the molecule. Within
+!! this loop it loops over the van-der-Waals domains of each atom in the
+!! moving set and finally over the atoms that belong to the 1-4 interaction
+!! set.
+!< ............................................................................
 
       real*8 function enyshe(nml)
 
-! ............................................................................
-!
-! PURPOSE: Calculate internal energy of molecule 'nml' with ECEPP parameters
-!
-! CALLS: none
-!
-! The function loops over all moving sets within the molecule. Within
-! this loop it loops over the van-der-Waals domains of each atom in the
-! moving set and finally over the atoms that belong to the 1-4 interaction
-! set.
-! ............................................................................
 
       include 'INCL.H'
Index: enyshe_p.f
===================================================================
--- enyshe_p.f	(revision 9f146faf232f2214724e0a5079115955f765219f)
+++ enyshe_p.f	(revision 3fbbfbbb0ad62653963eff7d22c1c42d1f789438)
@@ -13,15 +13,13 @@
       real*8 function enyshe(nml)
 
-!     ............................................................................
-!
-!     PURPOSE: Calculate internal energy of molecule 'nml' with ECEPP parameters
-!
-!     CALLS: none
-!
-!     The function loops over all moving sets within the molecule. Within
-!     this loop it loops over the van-der-Waals domains of each atom in the
-!     moving set and finally over the atoms that belong to the 1-4 interaction
-!     set.
-!     ............................................................................
+!>     PURPOSE: Calculate internal energy of molecule 'nml' with ECEPP parameters
+!!
+!!     CALLS: none
+!!
+!!     The function loops over all moving sets within the molecule. Within
+!!     this loop it loops over the van-der-Waals domains of each atom in the
+!!     moving set and finally over the atoms that belong to the 1-4 interaction
+!!     set.
+!<     ............................................................................
 
       include 'INCL.H'
Index: main.f
===================================================================
--- main.f	(revision 9f146faf232f2214724e0a5079115955f765219f)
+++ main.f	(revision 3fbbfbbb0ad62653963eff7d22c1c42d1f789438)
@@ -19,10 +19,11 @@
       program main
 
+      use timer
       include 'INCL.H'
       include 'INCP.H'
-      double precision eps, temp, e, energy
+      double precision eps, temp, e, energy, enyshe_simple
 
-      integer maxloglevel, logfileunit, iabin, imin, maxit, nequi
-      integer nsweep, nmes, ncalls, nacalls
+      integer iabin, imin, maxit, nequi
+      integer nsweep, nmes, ncalls, nacalls, i
 
       common/updstats/ncalls(5),nacalls(5)
@@ -42,5 +43,5 @@
 !     Set the maximum log level. The larger the number the more detailed
 !     the log.
-      MAXLOGLEVEL = 1
+      MAXLOGLEVEL = 100
 !     File unit to use for the log file.
       LOGFILEUNIT = 27
@@ -112,15 +113,26 @@
 !      call outvar(0, ' ')
 !     To do a canonical Monte Carlo simulation uncomment the lines below
-       nequi = 100
-       nsweep = 50000
-       nmes = 10
-       temp = 300.0
-       lrand = .true.
-       E = energy()
-       write (logString, *) E, eyel,eyvw,eyhb,eyvr
-       call outpdb(1, "polyA.pdb")
+      nequi = 100
+      nsweep = 500
+      nmes = 10
+      temp = 300.0
+      lrand = .true.
+      E = energy()
+      write (logString, *) E, eyel,eyvw,eyhb,eyvr
+      call outpdb(1, "polyrQ.pdb")
 !      Canonical Monte Carlo
-       call canon(nequi, nsweep, nmes, temp, lrand)
+      call init_timer()
+      call start_timer(1)
+      call canon(nequi, nsweep, nmes, temp, lrand)
+      call stop_timer(1)
 
+      E = 0
+!      call start_timer(1)
+!      do i =1, nsweep
+!         E = E + enyshe_simple()
+!      end do
+!      call stop_timer(1)
+      call evaluate(1)
+      print *,timingData(1)%average, "s.", E
 !      For simulated annealing uncomment the lines below
 !      tmin = 200.0
Index: partem_p.f
===================================================================
--- partem_p.f	(revision 9f146faf232f2214724e0a5079115955f765219f)
+++ partem_p.f	(revision 3fbbfbbb0ad62653963eff7d22c1c42d1f789438)
@@ -11,18 +11,18 @@
 !     **************************************************************
 
+!>
+!!     PURPOSE: SIMULATION OF PROTEINS BY PARALLEL TEMPERING ALGORITHM
+!!     ON PARALLEL COMPUTERS USING MPI
+!!
+!!     switch: Choses the starting configuration:
+!!     -1 - stretched configuration
+!!     0 - don't change anything
+!!     1 - random start configuration
+!!
+!!     CALLS:  addang,contacts,energy,hbond,helix,iendst,metropolis,
+!!     outvar,(rand),rgyr
+!<
       subroutine  partem_p(num_rep, nequi, nswp, nmes, nsave, newsta,
      &                     switch, rep_id, partem_comm)
-!     
-!     PURPOSE: SIMULATION OF PROTEINS BY PARALLEL TEMPERING ALGORITHM 
-!     ON PARALLEL COMPUTERS USING MPI
-!     
-!     switch: Choses the starting configuration:
-!     -1 - stretched configuration
-!     0 - don't change anything
-!     1 - random start configuration
-!     
-!     CALLS:  addang,contacts,energy,hbond,helix,iendst,metropolis,
-!     outvar,(rand),rgyr
-!     
       include 'INCL.H'
       include 'INCP.H'
Index: protein.py
===================================================================
--- protein.py	(revision 9f146faf232f2214724e0a5079115955f765219f)
+++ protein.py	(revision 3fbbfbbb0ad62653963eff7d22c1c42d1f789438)
@@ -6,5 +6,5 @@
 #
 import sys
-import smmp
+import smmp_p as smmp
 from math import *
 
Index: rgyr.f
===================================================================
--- rgyr.f	(revision 9f146faf232f2214724e0a5079115955f765219f)
+++ rgyr.f	(revision 3fbbfbbb0ad62653963eff7d22c1c42d1f789438)
@@ -11,17 +11,17 @@
 
 
-      subroutine rgyr(nml, rgy, ee)
+!> CALCULATES THE RADIUS-OF-GYRATION AND THE END-TO-END DISTANCE
+!! FOR A GIVEN PROTEIN CONFORMATION
+!! If nml == 0, calculate the radius of gyration for all molecules
+!!
+!!     rgy  = radius-of-gyration
+!!     ee   = end-to-end distance
+!!
+!! REQUIREMENTS: c_alfa has to be called BEFORE call of this subroutine
+!!
+!! CALLS: NONE
+!<
+	  subroutine rgyr(nml, rgy, ee)
 
-! CALCULATES THE RADIUS-OF-GYRATION AND THE END-TO-END DISTANCE
-! FOR A GIVEN PROTEIN CONFORMATION
-! If nml == 0, calculate the radius of gyration for all molecules
-!
-!     rgy  = radius-of-gyration
-!     ee   = end-to-end distance
-!
-! REQUIREMENTS: c_alfa has to be called BEFORE call of this subroutine
-!
-! CALLS: NONE
-!
       include 'INCL.H'
       
Index: timer.F90
===================================================================
--- timer.F90	(revision 9f146faf232f2214724e0a5079115955f765219f)
+++ timer.F90	(revision 3fbbfbbb0ad62653963eff7d22c1c42d1f789438)
@@ -59,8 +59,10 @@
             ! Initialize timers
             allocate (timingData(initialTimerCount))
-            forall(i = 1:initialTimerCount)
+!            forall(i = 1:initialTimerCount)
+            do i = 1, initialTimerCount
                 timingData(i) = TimingStructure(0, -1.0, -1.0, -1.0, -1.0, 0.0, &
                         0.0, -1.0, -1.0)
-            end forall
+!            end forall
+            end do
         end subroutine init_timer
     
Index: universe.py
===================================================================
--- universe.py	(revision 9f146faf232f2214724e0a5079115955f765219f)
+++ universe.py	(revision 3fbbfbbb0ad62653963eff7d22c1c42d1f789438)
@@ -4,5 +4,5 @@
 #                      Jan H. Meinke, Sandipan Mohanty
 #
-import smmp
+import smmp_p as smmp
 from math import *
 
Index: utilities.f
===================================================================
--- utilities.f	(revision 9f146faf232f2214724e0a5079115955f765219f)
+++ utilities.f	(revision 3fbbfbbb0ad62653963eff7d22c1c42d1f789438)
@@ -7,14 +7,15 @@
 ! *********************************************************************
 
-!! Calculate the best way to distribute the work load across processors.
-!  It calculates the average number of interactions and then tries to
-!  assign a number of interactions to each processor that is as close
-!  as possible to the average. The routine should be called once for
-!  every molecule in the system.
-!
-!  @param num_ppr Number of processors per replica
-!  @param nml index of molecule or zero.
-!
-!  @author Jan H. Meinke
+!> Calculate the best way to distribute the work load across processors.
+!!  It calculates the average number of interactions and then tries to
+!!  assign a number of interactions to each processor that is as close
+!!  as possible to the average. The routine should be called once for
+!!  every molecule in the system.
+!!
+!!  @param num_ppr Number of processors per replica
+!!  @param nml index of molecule or zero.
+!!
+!!  @author Jan H. Meinke
+!<
       subroutine distributeWorkLoad(num_ppr,nml)
 
@@ -117,26 +118,26 @@
       end subroutine distributeWorkLoad
 
-!-----------------------------------------------------------------------
-!     The function fileNameMP takes a template of a file name in the
-!     variable base. The position of the first and last character that
-!     may be replaced by rank in the string are given in i1 (first) and
-!     i2 (last).
-!     The function returns an empty string if the rank would need more
-!     characters than is allowed by the template.
-!     For example,
-!     \code
-!     rank = 11
-!     fileName = fileNameMP('base_0000.dat', 6, 9, rank)
-!     write (logString, *), fileName
-!     \endcode
-!     will output base_0011.dat.
-!
-!     @param base the base file name, e.g., base_0000.dat.
-!     @param i1 index of the first character that may be replaced
-!     @param i2 index of the last character that may be replaced
-!     @param rank the number that should be inserted into the file name.
-!
-!     @return file name for rank
-!-----------------------------------------------------------------------
+!>
+!!     The function fileNameMP takes a template of a file name in the
+!!     variable base. The position of the first and last character that
+!!     may be replaced by rank in the string are given in i1 (first) and
+!!     i2 (last).
+!!     The function returns an empty string if the rank would need more
+!!     characters than is allowed by the template.
+!!     For example,
+!!     \code
+!!     rank = 11
+!!     fileName = fileNameMP('base_0000.dat', 6, 9, rank)
+!!     write (logString, *), fileName
+!!     \endcode
+!!     will output base_0011.dat.
+!!
+!!     @param base the base file name, e.g., base_0000.dat.
+!!     @param i1 index of the first character that may be replaced
+!!     @param i2 index of the last character that may be replaced
+!!     @param rank the number that should be inserted into the file name.
+!!
+!!     @return file name for rank
+!<
       character*80 function fileNameMP(base, i1, i2, rank)
 
@@ -172,21 +173,22 @@
 
 
-!----------------------------------------------------------------------
-!     Add messages to log. This routine takes the log (debugging) mes-
-!     sages and writes them to the log file if the log level is less or
-!     equal to the maximum log level given by the global variable
-!     MAXLOGLEVEL.
-!
-!     @author Jan H. Meinke
-!
-!     @param loglevel level at which this message should be added to
-!            the log.
-!     @param message message to be written to the log.
-!     @param rank global rank of this node if running an MPI job zero
-!            otherwise.
-!----------------------------------------------------------------------
+!>
+!!     Add messages to log. This routine takes the log (debugging) mes-
+!!     sages and writes them to the log file if the log level is less or
+!!     equal to the maximum log level given by the global variable
+!!     MAXLOGLEVEL.
+!!
+!!     @author Jan H. Meinke
+!!
+!!     @param loglevel level at which this message should be added to
+!!            the log.
+!!     @param message message to be written to the log.
+!!     @param rank global rank of this node if running an MPI job zero
+!!            otherwise.
+!<
       subroutine addLogMessage(loglevel, message, rank)
 
-      integer maxloglevel, logfileunit
+         integer MAXLOGLEVEL, LOGFILEUNIT
+         common /log/MAXLOGLEVEL, LOGFILEUNIT
 
          integer :: loglevel, rank
