First attempt at functionality. Actually works! Although test value is a little bit high.