Adding all net code. The code is currently incorrect.