finished themostat js