committing all code for basic running system. doesn't work very well