Finished question 6. Fixed algorithms implemented.