Added comments and made background process running work