Refactored code, added injection current input, added additional comments