added input arguments and tested with an actual LMS