got things working, added in an extra function i should move to a separate file, added more to definition file