public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)  {    
    Player player = null;
    if (sender instanceof Player) {
      player = (Player) sender;
    }

    if (player == null) {
      sender.sendMessage(ChatColor.RED+"This command can only be run by a player");
      return true;
    }

    if (args.length == 0) {
      String Player_Name = player.getName();
      String worldName = player.getWorld().getName();

      if (plugin.getBedsConfig().getString(Player_Name+"."+worldName) != null) {
        String bedLocation = plugin.getBedsConfig().getString(Player_Name+"."+worldName);
        // compile location
        String[] vals = bedLocation.split(",");
        World world = Bukkit.getWorld(vals[0]);
        double x = Double.parseDouble(vals[1]);        
        double y = Double.parseDouble(vals[2]);
        double z = Double.parseDouble(vals[3]);      
        final Location loc = new Location(world, x, y+1, z);      
        player.teleport(loc);
        player.sendMessage(ChatColor.YELLOW+"You have been returned to your bed location for "+ChatColor.RESET+worldName);
        return true;
      } else {
        player.sendMessage(ChatColor.YELLOW+"You do not have a bed location set for "+ChatColor.RESET+worldName);
        return true;
      }
    } else if (args.length == 1 && player.hasPermission("simpleextras.bed.other")) {
      String targetName= plugin.myGetPlayerName(args[0]);
      String worldName = player.getWorld().getName();
      if (plugin.getBedsConfig().getString(targetName+"."+worldName) != null) {
        String bedLocation = plugin.getBedsConfig().getString(targetName+"."+worldName);
        // compile location
        String[] vals = bedLocation.split(",");
        World world = Bukkit.getWorld(vals[0]);
        double x = Double.parseDouble(vals[1]);        
        double y = Double.parseDouble(vals[2]);
        double z = Double.parseDouble(vals[3]);      
        final Location loc = new Location(world, x, y+1, z);      
        player.teleport(loc);
        player.sendMessage(ChatColor.YELLOW+"You have been returned to "+targetName+"'s bed location for "+ChatColor.RESET+worldName);
        return true;
      } else {
        player.sendMessage(ChatColor.YELLOW+targetName+" does not have a bed location set for "+ChatColor.RESET+worldName);
        return true;
      }
    }
    return true;
  }