replaced tabs with spaces, updated to use system timer