Whole night of work. Closing issues #10 #16 #17