Completed Assignment

Test function allows easy testing