most functions working, i think