added distance, size parameters to main function