updated timestamp to be more accurate by grabbing frame timestamp instead of the system timestamp. misc refactoring.