simplifying code
fixing grad verification
Linked layers; cleanup