Finished first requirement, but needs optimization.