code for basic implementation of neural networks module