fixed offset bug
comments and output cleaned up