got input working still ugly as all sin
some cleaning
fixed output
added generations