Replaced the begin with lighter code.