min function added
deleted some spaces