Initial commit. Still includes some bugs regarding reset.