4th commit - cleaning and fixing some bugs

but not yet completed