functionality almost complete. WIP