Moved to a class based approach, still not working however