Update logic.php

Added credit information to original project owner. Other minor changes to comments.