fixing #4
fixing #5 and general reformatting