implemented simulation thread and added playing of error sound