Cleaned up and added more arguments