commit 25

fixing and refactoring some code