Finished Whale code