Changed package name to optimize and updated error and panic messages as appropriate