more tweaking, added more features, will clean up