most things functional. changed things to mostly oop