started to clean up the code. corrected a little bug