moved files from header to seperate c file and worked on bugtesting