Fixed bug in distance function
Added args to main function