added several printLocks to improve console output