added dimensions parameter to popup function