Fixed frame update. Instead of using system("sleep 0.1") program uses nanosleep() from time.h.