Final version
Final version (maybe change from matrix multiplication to ''element-wise'' calculations)