cleaned up main tick function
moved code in index to separate file