use 'sleep' function to cut down on unnecessary cpu activity