little cleanup and standardised the internval parameter
fixed indentation tabs->spaces