added some more functions, still needs cleaning up