Refactored many pointer names. Applied some bug fixes.