initial working commit. likely still very buggy.