inital functions ported over, events and testing not working