started logging and some code division