Best attempt at completing this. Some issues.