Fixes #2. Created a median function, ignore the last commit