Fully implemented ladder logic