fixed marshalling by removing it
moved grain to lib, did some other stuff