fixes #18
fixes #17
fixes #16
fixes #15
cleaning code