Added system pause, cleaned functions