Fixed some issues. Code still broken