Added comments, made workspace name optional and added error handling