added more functionality.  kinda borked a little at the moment