First attempt at code.