Improved initial parameters, cleaned code, and improved performance