added queue and corrected issues