Removed redunant code.
Use INNER JOIN SQL instead of old ambiguous multiple table select.