cleaned up method for building tick arrays and updating, sql still needs work