I am trying to make an Applescript that launches a different set of apps depending on user input. However, it won't compile. What is wrong with it? I made a simple AppleScript that launches a different set of apps depending on user input. I am new to AppleScript and it is tweaked from a bunch I found on the internet, modified for my usage. It is included below.

What it should do: Buttons 2 and 3 simply launches various sets of apps, while button 1 checks if Spotify is running, and if it is, switches to it. If it isn't, open 3 apps (including Spotify).

However I get an "Expected end of line, etc. but found end of script." error when compiling. Here is the script. What is wrong with it?

set question to display dialog "What do you want to launch?" buttons {"Spotify", "MiniPlayer", "Remote"} default button 1
set answer to button returned of question

if answer is equal to "Spotify" then
    set myAppName to "Spotify"
    set isRunning to false
    tell application "System Events"
        if exists process myAppName then
            set isRunning to true
        end if
    end tell
    if isRunning is true then
        tell application myAppName to activate
    else
        tell application "Spotify" to activate
        tell application "Spotifree" to activate
        tell application "Spotify Notifications" to activate
    end if
end if
if answer is equal to "MiniPlayer" then
    tell application "MiniPlayer" to activate
end if
if answer is Equal to "Remote" then
    set question to display dialog "What remote do you want to launch?" buttons {"IR Remote", "Android", "Both"} default button 2
set answer to button returned of question
    if answer is equal to "IR Remote" then
    tell application SpotifyIrRemote to activate    
    if answer is equal to "Android"
        tell application RemotelessHelper to activate   
    if answer is equal to "Both"
        tell application SpotifyIrRemote to activate
        tell application RemotelessHelper to activate
    end if
end if
You are missing a bunch of end ifs and 2 then. 

set question to display dialog "What do you want to launch?" buttons {"Spotify", "MiniPlayer", "Remote"} default button 1
set answer to button returned of question

if answer is equal to "Spotify" then
    set myAppName to "Spotify"
    set isRunning to false
    tell application "System Events"
        if exists process myAppName then
            set isRunning to true
        end if
    end tell
    if isRunning is true then
        tell application myAppName to activate
    else
        tell application "Spotify" to activate
        tell application "Spotifree" to activate
        tell application "Spotify Notifications" to activate
    end if
end if

if answer is equal to "MiniPlayer" then
    tell application "MiniPlayer" to activate
end if

if answer is equal to "Remote" then
    set question to display dialog "What remote do you want to launch?" buttons {"IR Remote", "Android", "Both"} default button 2
    set answer to button returned of question
    if answer is equal to "IR Remote" then
        tell application SpotifyIrRemote to activate
    end if
    if answer is equal to "Android" then
        tell application RemotelessHelper to activate
    end if
    if answer is equal to "Both" then
        tell application SpotifyIrRemote to activate
        tell application RemotelessHelper to activate
    end if
end if